//
//  YCEmptyView.m
//  lianganyuchu
//
//  Created by iMac on 17/3/17.
//  Copyright © 2017年 杭州桑缇电子商务有限公司. All rights reserved.
//

#import "YCEmptyView.h"
#define IMG_WIDTH 62
#define IMG_HEIGHT 80

@interface YCEmptyView()
{
    UIImageView *m_imgView;
    UILabel *m_labTitle;
}
@end
@implementation YCEmptyView

- (id)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        [self addSubviewsWith:frame];
    }
    return self;
}
-(void)addSubviewsWith:(CGRect)frame
{
    [self setBackgroundColor:WHITE_COLOR];
    CGSize sizeView=frame.size;
    
    m_imgView=[[UIImageView alloc]initWithFrame:CGRectMake(0, 0, IMG_WIDTH, IMG_HEIGHT)];
    m_imgView.center=CGPointMake(sizeView.width*0.5, S(100)+IMG_HEIGHT/2);
    [self addSubview:m_imgView];
    
    m_labTitle=[[UILabel alloc]initWithFrame:CGRectMake(0, 0, sizeView.width*0.8, 45/2)];
    [m_labTitle setTextColor:getUIColor(0xaaaaaa)];
    [m_labTitle setFont:[UIFont LightFontOfSize:16]];
    m_labTitle.center=CGPointMake(sizeView.width*0.5, CGRectGetMaxY(m_imgView.frame)+45*3/4);
    [m_labTitle setTextAlignment:NSTextAlignmentCenter];
    [self addSubview:m_labTitle];
}
-(void)setEmptyWith:(NSString *)img Title:(NSString *)title
{
    [m_imgView setImage:[UIImage imageNamed:img]];
    [m_labTitle setText:title];
}

@end
